import { UtilsModule_blxf } from "../Module/UtilsModule";


const {ccclass, property} = cc._decorator;

/** 提示面板 */

@ccclass
export default class TipsPanel_blxf extends cc.Component {

    @property({ type: cc.Node, tooltip: '提示语' })
    msgNode: cc.Node = null;


    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

    start () {

    }

    // update (dt) {}


    /**
     * 初始化
     * @param options { tipsMsg: 提示语 }
     */
    initData_blxf ( options: any ) {
        let { tipsMsg } = options;

        UtilsModule_blxf.instance.setText_blxf( this.msgNode, tipsMsg );

        this.onAnimation();
    }

    onAnimation () {
        let _delayTime: number = 1.5, _moveTime: number = 0.6, _moveY: number = 100;
        cc.tween( this.node )
        .delay( _delayTime )
        .to( _moveTime, { y: _moveY, opacity: 0 }, cc.easeSineInOut() )
        .call(()=>{
            this.node.destroy();
        }).start();
    }
}
